<?php

namespace app\model;

use think\Model;

class Package extends Model
{
  protected $table = 'package';

  public function reservation()
  {
    return $this->belongsTo(Reservation::class, 'reservation_id'); // 修改: 关联到 Reservation 模型
  }

  public function packageDishes()
  {
    return $this->hasMany(PackageDish::class, 'package_id');
  }

  public function dishes()
  {
    return $this->belongsToMany(Dish::class, PackageDish::class, 'dish_id', 'package_id');
  }
}